package com.atguigu.my.chapter03

/**
 *
 * @description: 构造器案例
 * @time: 2020-05-22 17:36
 * @author: baojinlong 
 **/
object ConDemo02 {
  def main(args: Array[String]): Unit = {
    val a = new AA
    // 显示构造主构造器的原因是子类和主类产生关联,可以直接或者是间接都可以
    print(a)
  }
}

class B {
  println("b----")
}


class AA extends B {
  println("我是AA主构造器")

  def this(inName: String) {
    this
    print("调用了A.this(inName: String)")
  }
}